Optimal. Leaf size=91 \[ \sqrt {\frac {2}{5} \left (\sqrt {5}-1\right )} \tan ^{-1}\left (\frac {\sqrt {x+1}}{\sqrt {\sqrt {5}-2} \sqrt {x-1}}\right )-\cosh ^{-1}(x)+\sqrt {\frac {2}{5} \left (1+\sqrt {5}\right )} \tanh ^{-1}\left (\frac {\sqrt {x+1}}{\sqrt {2+\sqrt {5}} \sqrt {x-1}}\right ) \]
________________________________________________________________________________________
Rubi [B] time = 0.14, antiderivative size = 191, normalized size of antiderivative = 2.10, number of steps used = 9, number of rules used = 7, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.280, Rules used = {901, 991, 217, 206, 1034, 725, 204} \begin {gather*} \frac {\sqrt {\frac {1}{10} \left (\sqrt {5}-1\right )} \sqrt {x-1} \sqrt {x+1} \tan ^{-1}\left (\frac {2-\left (1-\sqrt {5}\right ) x}{\sqrt {2 \left (\sqrt {5}-1\right )} \sqrt {x^2-1}}\right )}{\sqrt {x^2-1}}-\frac {\sqrt {x-1} \sqrt {x+1} \tanh ^{-1}\left (\frac {x}{\sqrt {x^2-1}}\right )}{\sqrt {x^2-1}}-\frac {\sqrt {\frac {1}{10} \left (1+\sqrt {5}\right )} \sqrt {x-1} \sqrt {x+1} \tanh ^{-1}\left (\frac {2-\left (1+\sqrt {5}\right ) x}{\sqrt {2 \left (1+\sqrt {5}\right )} \sqrt {x^2-1}}\right )}{\sqrt {x^2-1}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 204
Rule 206
Rule 217
Rule 725
Rule 901
Rule 991
Rule 1034
Rubi steps
\begin {align*} \int \frac {\sqrt {-1+x} \sqrt {1+x}}{1+x-x^2} \, dx &=\frac {\left (\sqrt {-1+x} \sqrt {1+x}\right ) \int \frac {\sqrt {-1+x^2}}{1+x-x^2} \, dx}{\sqrt {-1+x^2}}\\ &=-\frac {\left (\sqrt {-1+x} \sqrt {1+x}\right ) \int \frac {1}{\sqrt {-1+x^2}} \, dx}{\sqrt {-1+x^2}}+\frac {\left (\sqrt {-1+x} \sqrt {1+x}\right ) \int \frac {x}{\left (1+x-x^2\right ) \sqrt {-1+x^2}} \, dx}{\sqrt {-1+x^2}}\\ &=-\frac {\left (\sqrt {-1+x} \sqrt {1+x}\right ) \operatorname {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\frac {x}{\sqrt {-1+x^2}}\right )}{\sqrt {-1+x^2}}+\frac {\left (\left (5-\sqrt {5}\right ) \sqrt {-1+x} \sqrt {1+x}\right ) \int \frac {1}{\left (1-\sqrt {5}-2 x\right ) \sqrt {-1+x^2}} \, dx}{5 \sqrt {-1+x^2}}+\frac {\left (\left (5+\sqrt {5}\right ) \sqrt {-1+x} \sqrt {1+x}\right ) \int \frac {1}{\left (1+\sqrt {5}-2 x\right ) \sqrt {-1+x^2}} \, dx}{5 \sqrt {-1+x^2}}\\ &=-\frac {\sqrt {-1+x} \sqrt {1+x} \tanh ^{-1}\left (\frac {x}{\sqrt {-1+x^2}}\right )}{\sqrt {-1+x^2}}-\frac {\left (\left (5-\sqrt {5}\right ) \sqrt {-1+x} \sqrt {1+x}\right ) \operatorname {Subst}\left (\int \frac {1}{-4+\left (1-\sqrt {5}\right )^2-x^2} \, dx,x,\frac {2-\left (1-\sqrt {5}\right ) x}{\sqrt {-1+x^2}}\right )}{5 \sqrt {-1+x^2}}-\frac {\left (\left (5+\sqrt {5}\right ) \sqrt {-1+x} \sqrt {1+x}\right ) \operatorname {Subst}\left (\int \frac {1}{-4+\left (1+\sqrt {5}\right )^2-x^2} \, dx,x,\frac {2-\left (1+\sqrt {5}\right ) x}{\sqrt {-1+x^2}}\right )}{5 \sqrt {-1+x^2}}\\ &=\frac {\sqrt {\frac {1}{10} \left (-1+\sqrt {5}\right )} \sqrt {-1+x} \sqrt {1+x} \tan ^{-1}\left (\frac {2-\left (1-\sqrt {5}\right ) x}{\sqrt {2 \left (-1+\sqrt {5}\right )} \sqrt {-1+x^2}}\right )}{\sqrt {-1+x^2}}-\frac {\sqrt {-1+x} \sqrt {1+x} \tanh ^{-1}\left (\frac {x}{\sqrt {-1+x^2}}\right )}{\sqrt {-1+x^2}}-\frac {\sqrt {\frac {1}{10} \left (1+\sqrt {5}\right )} \sqrt {-1+x} \sqrt {1+x} \tanh ^{-1}\left (\frac {2-\left (1+\sqrt {5}\right ) x}{\sqrt {2 \left (1+\sqrt {5}\right )} \sqrt {-1+x^2}}\right )}{\sqrt {-1+x^2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.21, size = 113, normalized size = 1.24 \begin {gather*} -\frac {1}{5} \sqrt {\sqrt {5}-2} \left (5+\sqrt {5}\right ) \tan ^{-1}\left (\sqrt {\sqrt {5}-2} \sqrt {\frac {x-1}{x+1}}\right )-2 \tanh ^{-1}\left (\sqrt {\frac {x-1}{x+1}}\right )-\frac {1}{5} \left (\sqrt {5}-5\right ) \sqrt {2+\sqrt {5}} \tanh ^{-1}\left (\sqrt {2+\sqrt {5}} \sqrt {\frac {x-1}{x+1}}\right ) \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [A] time = 0.31, size = 110, normalized size = 1.21 \begin {gather*} -\sqrt {\frac {1}{5} \left (2 \sqrt {5}-2\right )} \tan ^{-1}\left (\frac {\sqrt {\sqrt {5}-2} \sqrt {x-1}}{\sqrt {x+1}}\right )-2 \tanh ^{-1}\left (\frac {\sqrt {x-1}}{\sqrt {x+1}}\right )+\sqrt {\frac {1}{5} \left (2+2 \sqrt {5}\right )} \tanh ^{-1}\left (\frac {\sqrt {2+\sqrt {5}} \sqrt {x-1}}{\sqrt {x+1}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.43, size = 214, normalized size = 2.35 \begin {gather*} \frac {2}{5} \, \sqrt {5} \sqrt {2 \, \sqrt {5} - 2} \arctan \left (\frac {1}{8} \, \sqrt {-4 \, {\left (2 \, x + \sqrt {5} - 1\right )} \sqrt {x + 1} \sqrt {x - 1} + 8 \, x^{2} + 4 \, \sqrt {5} x - 4 \, x} \sqrt {2 \, \sqrt {5} - 2} {\left (\sqrt {5} + 1\right )} - \frac {1}{4} \, {\left (\sqrt {x + 1} \sqrt {x - 1} {\left (\sqrt {5} + 1\right )} - \sqrt {5} x - x - 2\right )} \sqrt {2 \, \sqrt {5} - 2}\right ) + \frac {1}{10} \, \sqrt {5} \sqrt {2 \, \sqrt {5} + 2} \log \left (2 \, \sqrt {x + 1} \sqrt {x - 1} - 2 \, x + \sqrt {5} + \sqrt {2 \, \sqrt {5} + 2} + 1\right ) - \frac {1}{10} \, \sqrt {5} \sqrt {2 \, \sqrt {5} + 2} \log \left (2 \, \sqrt {x + 1} \sqrt {x - 1} - 2 \, x + \sqrt {5} - \sqrt {2 \, \sqrt {5} + 2} + 1\right ) + \log \left (\sqrt {x + 1} \sqrt {x - 1} - x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.20, size = 16, normalized size = 0.18 \begin {gather*} \log \left ({\left (\sqrt {x + 1} - \sqrt {x - 1}\right )}^{2}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.09, size = 231, normalized size = 2.54 \begin {gather*} -\frac {\sqrt {x -1}\, \sqrt {x +1}\, \sqrt {5}\, \left (-\sqrt {5}\, \sqrt {-2+2 \sqrt {5}}\, \arctanh \left (\frac {\sqrt {5}\, x +x -2}{\sqrt {2 \sqrt {5}+2}\, \sqrt {x^{2}-1}}\right )-\sqrt {-2+2 \sqrt {5}}\, \arctanh \left (\frac {\sqrt {5}\, x +x -2}{\sqrt {2 \sqrt {5}+2}\, \sqrt {x^{2}-1}}\right )-\sqrt {5}\, \sqrt {2 \sqrt {5}+2}\, \arctan \left (\frac {\sqrt {5}\, x -x +2}{\sqrt {-2+2 \sqrt {5}}\, \sqrt {x^{2}-1}}\right )+\sqrt {2 \sqrt {5}+2}\, \arctan \left (\frac {\sqrt {5}\, x -x +2}{\sqrt {-2+2 \sqrt {5}}\, \sqrt {x^{2}-1}}\right )+\sqrt {5}\, \sqrt {2 \sqrt {5}+2}\, \sqrt {-2+2 \sqrt {5}}\, \ln \left (x +\sqrt {x^{2}-1}\right )\right )}{5 \sqrt {x^{2}-1}\, \sqrt {2 \sqrt {5}+2}\, \sqrt {-2+2 \sqrt {5}}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} -\int \frac {\sqrt {x + 1} \sqrt {x - 1}}{x^{2} - x - 1}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 5.02, size = 916, normalized size = 10.07 \begin {gather*} -4\,\mathrm {atanh}\left (\frac {\sqrt {x-1}-\mathrm {i}}{\sqrt {x+1}-1}\right )-\frac {\sqrt {10}\,\mathrm {atan}\left (\frac {3408370\,\sqrt {10}\,\sqrt {\sqrt {5}+1}-\sqrt {10}\,\sqrt {\sqrt {5}+1}\,\sqrt {x-1}\,300730{}\mathrm {i}-3408370\,\sqrt {10}\,\sqrt {\sqrt {5}+1}\,\sqrt {x+1}-1771398\,\sqrt {5}\,\sqrt {10}\,\sqrt {\sqrt {5}+1}+7836865\,\sqrt {10}\,x\,\sqrt {\sqrt {5}+1}+3066340\,\sqrt {10}\,x^2\,\sqrt {\sqrt {5}+1}-1294942\,\sqrt {5}\,\sqrt {10}\,x^2\,\sqrt {\sqrt {5}+1}+\sqrt {10}\,\sqrt {\sqrt {5}+1}\,\sqrt {x-1}\,\sqrt {x+1}\,300730{}\mathrm {i}-\sqrt {5}\,\sqrt {10}\,\sqrt {\sqrt {5}+1}\,\sqrt {x-1}\,134482{}\mathrm {i}+1771398\,\sqrt {5}\,\sqrt {10}\,\sqrt {\sqrt {5}+1}\,\sqrt {x+1}-\sqrt {10}\,x\,\sqrt {\sqrt {5}+1}\,\sqrt {x-1}\,300730{}\mathrm {i}-6132680\,\sqrt {10}\,x\,\sqrt {\sqrt {5}+1}\,\sqrt {x+1}-3475583\,\sqrt {5}\,\sqrt {10}\,x\,\sqrt {\sqrt {5}+1}+\sqrt {5}\,\sqrt {10}\,\sqrt {\sqrt {5}+1}\,\sqrt {x-1}\,\sqrt {x+1}\,134482{}\mathrm {i}+\sqrt {10}\,x\,\sqrt {\sqrt {5}+1}\,\sqrt {x-1}\,\sqrt {x+1}\,150365{}\mathrm {i}-\sqrt {5}\,\sqrt {10}\,x\,\sqrt {\sqrt {5}+1}\,\sqrt {x-1}\,134482{}\mathrm {i}+2589884\,\sqrt {5}\,\sqrt {10}\,x\,\sqrt {\sqrt {5}+1}\,\sqrt {x+1}+\sqrt {5}\,\sqrt {10}\,x\,\sqrt {\sqrt {5}+1}\,\sqrt {x-1}\,\sqrt {x+1}\,67241{}\mathrm {i}}{29119280\,x-24066900\,x\,\sqrt {x+1}-11518800\,\sqrt {5}\,x-10104760\,\sqrt {x+1}-7067880\,\sqrt {5}-3992430\,\sqrt {5}\,x^2+12033450\,x^2+7067880\,\sqrt {5}\,\sqrt {x+1}+7984860\,\sqrt {5}\,x\,\sqrt {x+1}+10104760}\right )\,\sqrt {\sqrt {5}+1}\,1{}\mathrm {i}}{5}-\frac {\sqrt {10}\,\mathrm {atan}\left (\frac {3408370\,\sqrt {10}\,\sqrt {1-\sqrt {5}}+3066340\,\sqrt {10}\,x^2\,\sqrt {1-\sqrt {5}}-\sqrt {10}\,\sqrt {1-\sqrt {5}}\,\sqrt {x-1}\,300730{}\mathrm {i}-3408370\,\sqrt {10}\,\sqrt {1-\sqrt {5}}\,\sqrt {x+1}+1771398\,\sqrt {5}\,\sqrt {10}\,\sqrt {1-\sqrt {5}}+7836865\,\sqrt {10}\,x\,\sqrt {1-\sqrt {5}}+3475583\,\sqrt {5}\,\sqrt {10}\,x\,\sqrt {1-\sqrt {5}}+1294942\,\sqrt {5}\,\sqrt {10}\,x^2\,\sqrt {1-\sqrt {5}}+\sqrt {10}\,\sqrt {1-\sqrt {5}}\,\sqrt {x-1}\,\sqrt {x+1}\,300730{}\mathrm {i}+\sqrt {5}\,\sqrt {10}\,\sqrt {1-\sqrt {5}}\,\sqrt {x-1}\,134482{}\mathrm {i}-1771398\,\sqrt {5}\,\sqrt {10}\,\sqrt {1-\sqrt {5}}\,\sqrt {x+1}-\sqrt {10}\,x\,\sqrt {1-\sqrt {5}}\,\sqrt {x-1}\,300730{}\mathrm {i}-6132680\,\sqrt {10}\,x\,\sqrt {1-\sqrt {5}}\,\sqrt {x+1}-\sqrt {5}\,\sqrt {10}\,\sqrt {1-\sqrt {5}}\,\sqrt {x-1}\,\sqrt {x+1}\,134482{}\mathrm {i}+\sqrt {10}\,x\,\sqrt {1-\sqrt {5}}\,\sqrt {x-1}\,\sqrt {x+1}\,150365{}\mathrm {i}+\sqrt {5}\,\sqrt {10}\,x\,\sqrt {1-\sqrt {5}}\,\sqrt {x-1}\,134482{}\mathrm {i}-2589884\,\sqrt {5}\,\sqrt {10}\,x\,\sqrt {1-\sqrt {5}}\,\sqrt {x+1}-\sqrt {5}\,\sqrt {10}\,x\,\sqrt {1-\sqrt {5}}\,\sqrt {x-1}\,\sqrt {x+1}\,67241{}\mathrm {i}}{29119280\,x-24066900\,x\,\sqrt {x+1}+11518800\,\sqrt {5}\,x-10104760\,\sqrt {x+1}+7067880\,\sqrt {5}+3992430\,\sqrt {5}\,x^2+12033450\,x^2-7067880\,\sqrt {5}\,\sqrt {x+1}-7984860\,\sqrt {5}\,x\,\sqrt {x+1}+10104760}\right )\,\sqrt {1-\sqrt {5}}\,1{}\mathrm {i}}{5} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \int \frac {\sqrt {x - 1} \sqrt {x + 1}}{x^{2} - x - 1}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________